package com.baijiaoxi.common.model.file;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class DelFile {

    private List<String> fileKeyList;

    public DelFile() {
    }

    public DelFile(String fileKey) {
        if (fileKey != null && !fileKey.isEmpty()) {
            this.fileKeyList = new ArrayList<>();
            fileKeyList.add(fileKey);
        }
    }

    public DelFile(List<String> fileKeyList) {
        if (fileKeyList != null && !fileKeyList.isEmpty())
            this.fileKeyList = fileKeyList;
    }

    public DelFile put(String fileKey) {
        if (fileKey != null && !fileKey.isEmpty()) {
            if (this.fileKeyList == null)
                this.fileKeyList = new ArrayList<>();
            fileKeyList.add(fileKey);
        }
        return this;
    }
}
